﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using BCL.WPFComponent.Base;

namespace BCL.WPFComponent
{
    /// <summary>
    /// UCMessageBox.xaml 的交互逻辑
    /// </summary>
    public partial class UCMessageBox : BaseShowControl
    {
        public UCMessageBox()
        {
            InitializeComponent();
        }
        private MessageBoxResult MessageBox= MessageBoxResult.None;
        public override void LanguageBinding()
        {
         
        }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            MessageBox = MessageBoxResult.OK;
            this.Close();
        }

        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            this.Close();
        }


        public static MessageBoxResult Show(string messageBoxText, string caption, MessageBoxButton button)
        {
            UCMessageBox box = new UCMessageBox();
            box.textBlock1.Text = messageBoxText;
            box.Title = caption;
            switch (button)
            {
                case MessageBoxButton.OK:
                    box.buttonsave.Visibility = Visibility.Visible;
                    break;
                case MessageBoxButton.YesNo:
                case MessageBoxButton.YesNoCancel:
                case MessageBoxButton.OKCancel:
                    box.buttonsave.Visibility = Visibility.Visible;
                    box.buttonclose.Visibility = Visibility.Visible;
                    break;
                default:
                    break;
            }
            box.ShowDialog(null);
            return box.MessageBox;
        }

        public static MessageBoxResult Show(string messageBoxText, string caption)
        {
            UCMessageBox box = new UCMessageBox();
            box.buttonsave.Visibility = Visibility.Visible;
            box.textBlock1.Text = messageBoxText;
            box.Title = caption;
            box.ShowDialog(null);
            return MessageBoxResult.OK;
        }

        public static MessageBoxResult Show(string messageBoxText)
        {
            UCMessageBox box = new UCMessageBox();
            box.buttonsave.Visibility = Visibility.Visible;
            box.textBlock1.Text = messageBoxText;
            box.ShowDialog(null);
            return MessageBoxResult.OK;
        }


    }
}
